﻿// Original author contact info: Owen Emlen (owene_1998@yahoo.com)
// Note: other individuals may also have contributed to this code
// Project hosted on CodePlex.com as of 1/10/2009 at http://wpfimageviewer.codeplex.com
using System;
using System.Linq;
using System.Collections.Specialized;
using System.ComponentModel;
using System.IO;
using BrainTechLLC;
using ImageAppDataModels;
using System.Collections.Generic;
using BrainTechLLC.ThreadSafeObjects;
using BrainTechLLC.WPF;

namespace ImageAppViewModels
{
    public class SpecialFolder : BaseNotifyPropertyChangedUI
    {
        protected string _Path;
        protected string _Name;

        public string Path
        {
            get { return _Path; }
            set
            {
                if (_Path != value)
                {
                    _Path = value;
                    if (!Directory.Exists(_Path))
                    {
                        Directory.CreateDirectory(_Path);
                    }
                    OnPropertyChanged("Path");
                }
            }
        }        

        public string Name
        {
            get { return _Name; }
            set
            {
                if (_Name != value)
                {
                    _Name = value;
                    OnPropertyChanged("Name");
                }
            }
        }

        public SpecialFolder()
        {
        }

        public string GetDestinationPath(string fileName)
        {
            if (Path.EndsWith("\\"))
            {
                return Path + fileName;
            }
            else
            {
                return Path + "\\" + fileName;
            }
        }
    }
}
